class CreateUsers < ActiveRecord::Migration
  def self.up
    create_table :users do |t|
      t.column  'name',           :string,  :null => false
      t.column  'email',          :string,  :null => false
      t.column  'password_salt',  :string,  :null => false
      t.column  'password_hash',  :string,  :null => false
      t.column  'is_teacher',     :integer, :null => false, :default => 0
      t.column  'is_admin',       :integer, :null => false, :default => 0
    end
    add_index   :users, :email, :unique => true
  end

  def self.down
    drop_table :users
  end
end
